<template>
  <view class="my-search-container" :style="{ 'background-color': bgCoolr }">
    <view class="my-search-box" @click="toSearch">
      <uni-icons type="search" size="18"></uni-icons>
      <text class="palceholder">{{ palceholder }}</text>
    </view>
  </view>
</template>
<script>
export default {
  data () {
    return {}
  },
  props: {
    bgCoolr: {
      type: String,
      default: '#c00000'
    },
    palceholder: {
      type: String,
      default: '搜索'
    }
  },
  methods: {
    toSearch () {
      // navigateTo 保留当前页面，跳转到应用内的某个页面，使用uni.navigateBack可以返回到原页面。
      uni.navigateTo({
        url: '/subpkg/search/index'
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.my-search-container {
  //   background-color: #c00000;
  height: 50px;
  padding: 0px 10px;
  display: flex;
  align-items: center;
}
.my-search-box {
  height: 36px;
  background-color: #ffff;
  border-radius: 16px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.palceholder {
  font-size: 15px;
  margin-left: 5px;
}
</style>
